package cn.gok.web.controllers;

import cn.gok.web.beans.User;
import cn.gok.web.daos.UserDao;
import cn.gok.web.services.UserService;
import cn.gok.web.services.serviceImpl.UserServiceImpl;
import com.alibaba.fastjson.JSON;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/user/")
public class UserController {
    @Autowired
    private UserDao userDao;
    private UserServiceImpl userService;

    @RequestMapping("allUsers")
    @ResponseBody
    public String selectAll(){
        User user=new User();
        return JSON.toJSONString(userDao.selectAll(user));
    }

    @RequestMapping("index")
    public String toIndex(){
        return "/userIndex/index";
    }



}
